<?php
	$id=$_GET['id'];
	$filename=$_POST['filename'];
	$cateID = $_POST['cateID'];
	
	$target="../download/";
	$link=$target.$_FILES['filelink']['name'];
	move_uploaded_file($_FILES['filelink']['tmp_name'],$link);
	
	$query="UPDATE productdownloads SET cateID='$cateID',filename='$filename',filelink='$link' WHERE id=$id";
	mysql_query($query);
	echo "Sửa file download thành công.";
	echo "<script>window.location='index.php?admin=downloadAdmin&do=listdownload'</script>";
?>